#ifndef ABSTRACT_EVENT_H
#define ABSTRACT_EVENT_H

#include <memory>

namespace event
{
class EventInterface;
using EventInterfaceSharedPtr = std::shared_ptr<EventInterface>;

class EventInterface
{
public:
  virtual void run() = 0;
};

template<typename Body>
class SimpleEventInterface: public EventInterface
{
public:
  explicit SimpleEventInterface(Body &&body)
      : body_(std::forward<Body>(body))
  {}

  void run() override
  {
    body_();
  }

private:
  Body body_;
};
}// namespace event

#endif//ABSTRACT_EVENT_H
